home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
DB_CLIPP
/
0643A.ZIP
/
DATES
/
TIMSET.PRG
< prev
Wrap
Text File
|
1987-04-11
|
2KB
|
76 lines
* TIMSET.PRG
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Neither dBASE III nor dBASE III PLUS have the ability to set or change
* the system time. However, this routine will do it nicely. It is placed
* in the public domain as freeware. Please feel free to incorporate it
* into your programs.
*
* Pat Adams
* DB Unlimited
* (718) 469-4961
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
SET TALK OFF
SET STATUS OFF
SET SCOREBOARD OFF
STORE " " TO GOOD
DO WHILE UPPER(GOOD) # "Y"
STORE SPACE(5) TO NOW
SET COLOR TO W/N, W/N, N
CLEAR
SET COLOR TO +B/W
@ 06,12 TO 16,67 DOUBLE
SET COLOR TO +BR/W
@ 05,24 TO 07,56
SET COLOR TO BR/W
@ 06,25 CLEAR TO 06,55
@ 06,26 SAY "SET OR CHANGE THE SYSTEM TIME"
SET COLOR TO B/W, W+/B
@ 07,13 CLEAR TO 15,66
* User input of new time
@ 09,16 SAY "Please enter the new time in a 24 hour increment."
@ 11,16 SAY "For example, 8:00 am would be 08:00, 8 pm would"
@ 12,16 SAY "be 20:00 and so on."
@ 14,38 GET NOW PICTURE "@Z 99:99"
READ
SET COLOR TO W/N, W/N, N
CLEAR
SET COLOR TO +BR/W
@ 02,24 TO 04,56
SET COLOR TO BR/W
@ 03,25 CLEAR TO 03,55
@ 03,26 SAY "SET OR CHANGE THE SYSTEM TIME"
SET COLOR TO N/W
@ 07,16 TO 17,62 DOUBLE
SET COLOR TO +GR/W, +GR/N
@ 08,17 CLEAR TO 16,61
* User validation of input
@ 10,31 SAY "You entered " + TRANSFORM(NOW, "99:99") + "."
@ 12,31 SAY "IS THIS CORRECT?"
STORE " " TO GOOD
DO WHILE AT(GOOD, "YyNn") = 0
* Error trapping routine permits only Y or N entry
@ 14,29 SAY "Please enter Y or N: " GET GOOD PICTURE "@!"
READ
ENDDO while at(good, "YyNn") = 0
IF UPPER(GOOD) = "N"
* Loop to permit user to re-enter data
LOOP
ENDIF
CLEAR
* Create memory variable usable in DOS for time setting
STORE SUBSTR(NOW,1,2) + ":" + SUBSTR(NOW,4,2) TO NEW
* Return to DOS to set the time
?
?
RUN TIME &NEW
ENDDO while upper(good) # "Y"
RETURN
* END Timset.Prg